package cn.com.se.设计模式.观察者模式;

public class Test {

    public static void main(String[] args) {
        WechatServer server = new WechatServer();

        Observer userZhang = new User("zhangsan");
        Observer useLi = new User("lisi");
        Observer userWang = new User("wangwu");

        server.registerObserver(userZhang);
        server.registerObserver(useLi);
        server.registerObserver(userWang);
        server.setInfomation("你好！");

        System.out.println("-----------------------------------");
        server.removeObserver(userZhang);
        server.setInfomation("你好啊！！！");
    }
}
